package weifei.live.simulation.entity.dto;


import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import weifei.live.simulation.entity.User;


@Data
public class UserDTO
{
    private final int id;
    private final int avatarId;
    private final String nickname;
    private final String username;

    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private final java.util.Date registerTime;
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private final java.util.Date lastLoginTime;
    private int state;


    public UserDTO(User user)
    {
        this.id = user.getId();
        this.avatarId = user.getAvatarId();
        this.nickname = user.getNickname();
        this.username = user.getUsername();
        this.registerTime = user.getRegisterTime();
        this.lastLoginTime = user.getLastLoginTime();
    }
}


